import { ResPage, ExamTest, ResultData } from "@/api/interface/index";
import http from "@/api";

/**
 * @name 考试管理模块
 */
// 获取考试列表
export const getExamList = (params: ExamTest.ReqExamTestParams) => {
  return http.post<ResPage<ExamTest.ResExamTestList>>(`/exam/test/query`, params);
};
// 获取考试详情
export const getExamDtl = (params: { testId: number }) => {
  return http.post<ResultData>(`/exam/test/detail`, params);
};
// 新增考试
export const addExam = (params = {}) => {
  return http.post(`/exam/test/add`, params);
};
// 编辑考试
export const editExam = (params: { testId: number }) => {
  return http.post(`/exam/test/modify`, params);
};

// 删除考试
export const deleteExam = (params: { testId: string }) => {
  return http.post(`/exam/test/remove`, params);
};

// 删除考试
export const startTest = (params: { testId: string }) => {
  return http.post(`/exam/test/start`, params);
};

// 删除考试
export const finishTest = (params: { testId: string }) => {
  return http.post(`/exam/test/end`, params);
};
